if(Drupal.jsEnabled){
	$(document).ready(function(){
		
		var message;
		var new_prod_table;
		
		var DelFunct = function(){
			var seriesDeleted = function(data){
				var result = Drupal.parseJson(data);
				if(result['status'])
					$('div.status-msg').fadeIn('def').html(result['status']);
				
				$('div.productions-in-series-area').fadeIn('def').html(result['msg']);
			}
			$.get(this.href, null, seriesDeleted);
				
			return false;
		}
		
		$('a.add-link').click(function(){
			var seriesAdded = function(data){
				var result = Drupal.parseJson(data);
				if(result['status'])
					$('div.status-msg').fadeIn('def').html(result['status']);
				$('div.productions-in-series-area').fadeIn('def').html(result['msg']);
			}
			$(this).ajaxSend(function(){
				$('div.productions-in-series-area').html('Start');
			});
			$(this).ajaxSuccess(function(){
				$('a.del-link').click(DelFunct);
			});
			$.get(this.href, null, seriesAdded);
			
			return false;
		});
	});
}